package se.robertfoss.ChanImageBrowser;

import java.io.File;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.widget.ProgressBar;

public class ImageHandler extends Handler{
	
	ImageAdapter ia;
	
	public ImageHandler(ImageAdapter ia) {
		super();
		this.ia = ia;
	}

	@Override
	public void handleMessage(Message msg) {
		Bundle data = msg.getData();
		String filename = data.getString("filename");
		Log.d(getClass().getName(), "Received message containing \"filename\"=\"" + filename + "\"");
		File file = new File(filename);
		ia.addItem(file);
	}
}
